// 导入axios对象
import { instance } from '../request.js'


// 查询所有
function queryList(queryUser){
    return instance({
        method:"get",
        url:'/sys/users',
        params:{
           userUsername:queryUser.userUsername,
           pageNum:queryUser.pageNum,
           pageSize:queryUser.pageSize     
        }
    })
}

// 新增用户
export const userAddService = (userModel)=>{
    return instance.post("/sys/users",userModel)
}

// 删除用户
function deleteById(id){
    return instance.delete(`/sys/users/${id}`)
}


// 修改用户
export const userUpdateService = (userModel)=>{
    let id = userModel.userId
    return instance.put(`/sys/users/${id}`,userModel)
}

export {
    queryList,
    deleteById
}
